package org.mat.ipaas.ucenter.service.api.system;

import com.baomidou.mybatisplus.core.metadata.IPage;
import org.mat.framework.lang.dto.MatApiResponse;
import org.mat.ipaas.ucenter.service.dto.system.entity.SysUserAgentDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Title: Controller
 * 用户代理人设置
 */
@FeignClient(name = "mat-ipaas-ucenter-service", contextId = "sys-user-agent-rest-api")
public interface SysUserAgentRestAPI {

    /**
     * 分页列表查询
     *
     * @param sysUserAgentDTO
     * @param pageNo
     * @param pageSize
     * @return
     */
    @GetMapping(value = "/sys/sysUserAgent/list")
    MatApiResponse<IPage<SysUserAgentDTO>> queryPageList(@SpringQueryMap SysUserAgentDTO sysUserAgentDTO,
                                                         @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
                                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize);

    /**
     * 添加
     *
     * @param sysUserAgentDTO
     * @return
     */
    @PostMapping(value = "/sys/sysUserAgent/add")
    MatApiResponse<SysUserAgentDTO> add(@RequestBody SysUserAgentDTO sysUserAgentDTO);

    /**
     * 编辑
     *
     * @param sysUserAgentDTO
     * @return
     */
    @RequestMapping(value = "/sys/sysUserAgent/edit", method = {RequestMethod.POST})
    MatApiResponse<SysUserAgentDTO> edit(@RequestBody SysUserAgentDTO sysUserAgentDTO);

    /**
     * 通过id删除
     *
     * @param id
     * @return
     */
    @DeleteMapping(value = "/sys/sysUserAgent/delete")
    MatApiResponse<SysUserAgentDTO> delete(@RequestParam(name = "id", required = true) String id);

    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
    @DeleteMapping(value = "/sys/sysUserAgent/deleteBatch")
    MatApiResponse<SysUserAgentDTO> deleteBatch(@RequestParam(name = "ids", required = true) String ids);

    /**
     * 通过id查询
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/sys/sysUserAgent/queryById")
    MatApiResponse<SysUserAgentDTO> queryById(@RequestParam(name = "id", required = true) String id);

    /**
     * 通过userName查询
     *
     * @param userName
     * @return
     */
    @GetMapping(value = "/sys/sysUserAgent/queryByUserName")
    MatApiResponse<SysUserAgentDTO> queryByUserName(@RequestParam(name = "userName", required = true) String userName);

    /**
     * 导出excel
     *
     * @param sysUserAgentDTO
     * 
     */
    @RequestMapping(value = "/sys/sysUserAgent/exportXls")
    ModelAndView exportXls(SysUserAgentDTO sysUserAgentDTO, @RequestParam HttpServletRequest request);

    /**
     * 通过excel导入数据
     *
     * 
     * 
     * @return
     */
    @RequestMapping(value = "/sys/sysUserAgent/importExcel", method = RequestMethod.POST)
    MatApiResponse<?> importExcel( );

}
